package movee.domain.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.SchemaProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.sql.Timestamp;
import java.util.List;

/**
 *
 *
 * @author movee
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@Schema(description = "查询设备备份情况")
@JsonIgnoreProperties(ignoreUnknown = true)
public class BackupDeviceSearchQuery {

    @SchemaProperty(name = "表的名字")
    private String tableName;

    @SchemaProperty(name = "任务ID")
    private Long taskId;

    @SchemaProperty(name = "操作人")
    private String operator;

    @SchemaProperty(name = "设备管理ip")
    private String mgmtIp;

    @SchemaProperty(name = "设备主机名")
    private String hostname;

    @SchemaProperty(name = "状态")
    @Size(max = 10, message = "statuses列表元数最大个数为10")
    private List<String> statuses;

    @SchemaProperty(name = "机房")
    @Size(max = 10, message = "iazs列表元数最大个数为10")
    private List<String> iazs;

    @SchemaProperty(name = "集群")
    @Size(max = 10, message = "clusters列表元数最大个数为10")
    private List<String> clusters;

    @SchemaProperty(name = "POD")
    @Size(max = 10, message = "pods列表元数最大个数为10")
    private List<String> pods;

    @SchemaProperty(name = "角色")
    @Size(max = 10, message = "roles列表元数最大个数为10")
    private List<String> roles;

    @SchemaProperty(name = "厂商")
    @Size(max = 10, message = "vendors列表元数最大个数为10")
    private List<String> vendors;

    @SchemaProperty(name = "型号")
    @Size(max = 10, message = "models列表元数最大个数为10")
    private List<String> models;

    @SchemaProperty(name = "是否变化")
    private Boolean changed;

    @SchemaProperty(name = "设备管理ip列表")
    @Size(max = 10, message = "mgmtIpList列表元数最大个数为10")
    private List<String> mgmtIpList;

    @SchemaProperty(name = "设备主机名列表")
    @Size(max = 10, message = "hostnameList列表元数最大个数为10")
    private List<String> hostnameList;

    @SchemaProperty(name = "错误类型列表")
    @Size(max = 10, message = "errTypes列表元数最大个数为10")
    private List<String> errTypes;

    @SchemaProperty(name = "开始时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp startTime;

    @SchemaProperty(name = "结束时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp endTime;

    @SchemaProperty(name = "查询页号，默认值1")
    @NotNull(message = "page字段不能为null且值应该大于等于1")
    @Min(value = 1, message = "page字段值应该大于等于1")
    private Integer page = 1;

    @SchemaProperty(name = "查询页面大小，默认值20")
    @NotNull(message = "size字段不能为null且值应该大于等于1")
    @Min(value = 1, message = "size字段值应该大于等于1")
    private Integer size = 20;

}
